import 'package:flutter/material.dart';

import 'package:flutter_swiper/flutter_swiper.dart';

class Swipers extends StatefulWidget {
  Swipers({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _SwipersState createState() => new _SwipersState();
}

class _SwipersState extends State<Swipers> {
  List<String> images = [
    "images/3.jpeg",
    "images/4.jpeg",
    "images/5.jpeg",
  ];
  @override
  Widget build(BuildContext context) {
    return new Swiper(
        layout: SwiperLayout.STACK,
        customLayoutOption:
            new CustomLayoutOption(startIndex: -1, stateCount: 3)
                .addRotate([-45.0 / 180, 0.0, 45.0 / 180]).addTranslate([
          new Offset(-370.0, -40.0),
          new Offset(0.0, 0.0),
          new Offset(370.0, -40.0)
        ]),
        itemWidth: 380.0,
        itemHeight: 200.0,
        itemBuilder: (context, index) {
          return new Container(
            color: Colors.amber,
            child: new Center(
              child: Image.asset(
                images[index],
                fit: BoxFit.fill,
                width: 380,
              ),
            ),
          );
        },
        itemCount: 3);
  }
}
